<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
  Class: RubyMotionQuery::Events
  
    &mdash; Documentation by YARD 0.8.7.3
  
</title>

  <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />

  <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  hasFrames = window.top.frames.main ? true : false;
  relpath = '../';
  framesUrl = "../frames.html#!" + escape(window.location.href);
</script>


  <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>

  <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>


  </head>
  <body>
    <div id="header">
      <div id="menu">
  
    <a href="../_index.html">Index (E)</a> &raquo;
    <span class='title'><span class='object_link'><a href="../RubyMotionQuery.html" title="RubyMotionQuery (module)">RubyMotionQuery</a></span></span>
     &raquo; 
    <span class="title">Events</span>
  

  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  
    <a class="full_list_link" id="class_list_link"
        href="../class_list.html">
      Class List
    </a>
  
    <a class="full_list_link" id="method_list_link"
        href="../method_list.html">
      Method List
    </a>
  
    <a class="full_list_link" id="file_list_link"
        href="../file_list.html">
      File List
    </a>
  
</div>
      <div class="clear"></div>
    </div>

    <iframe id="search_frame"></iframe>

    <div id="content"><h1>Class: RubyMotionQuery::Events
  
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName"><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></span>
      
        <ul class="fullTree">
          <li><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></li>
          
            <li class="next">RubyMotionQuery::Events</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
  
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">motion/ruby_motion_query/events.rb</dd>
  
</dl>
<div class="clear"></div>








  
    <h2>
      Instance Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#%5B%5D-instance_method" title="#[] (instance method)">- (Object) <strong>[]</strong>(sdk_event_or_recognizer) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#has_event%3F-instance_method" title="#has_event? (instance method)">- (Boolean) <strong>has_event?</strong>(sdk_event_or_recognizer) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#has_events%3F-instance_method" title="#has_events? (instance method)">- (Boolean) <strong>has_events?</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#initialize-instance_method" title="#initialize (instance method)">- (Events) <strong>initialize</strong> </a>
    

    
  </span>
  
  
    <span class="note title constructor">constructor</span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>A new instance of Events.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#off-instance_method" title="#off (instance method)">- (Object) <strong>off</strong>(*events) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#on-instance_method" title="#on (instance method)">- (Object) <strong>on</strong>(view, event, args = {}, &amp;block) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
    </ul>
  

<div id="constructor_details" class="method_details_list">
  <h2>Constructor Details</h2>
  
    <div class="method_details first">
  <h3 class="signature first" id="initialize-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::Events (class)">Events</a></span></tt>) <strong>initialize</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns a new instance of Events</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


110
111
112</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/events.rb', line 110</span>

<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
  <span class='ivar'>@event_set</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
  
</div>


  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>

    
      <div class="method_details first">
  <h3 class="signature first" id="[]-instance_method">
  
    - (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>[]</strong>(sdk_event_or_recognizer) 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


114
115
116</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/events.rb', line 114</span>

<span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_sdk_event_or_recognizer'>sdk_event_or_recognizer</span><span class='rparen'>)</span>
  <span class='ivar'>@event_set</span><span class='lbracket'>[</span><span class='id identifier rubyid_sdk_event_or_recognizer'>sdk_event_or_recognizer</span><span class='rbracket'>]</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="has_event?-instance_method">
  
    - (<tt>Boolean</tt>) <strong>has_event?</strong>(sdk_event_or_recognizer) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


122
123
124</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/events.rb', line 122</span>

<span class='kw'>def</span> <span class='id identifier rubyid_has_event?'>has_event?</span><span class='lparen'>(</span><span class='id identifier rubyid_sdk_event_or_recognizer'>sdk_event_or_recognizer</span><span class='rparen'>)</span>
  <span class='ivar'>@event_set</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_sdk_event_or_recognizer'>sdk_event_or_recognizer</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="has_events?-instance_method">
  
    - (<tt>Boolean</tt>) <strong>has_events?</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


118
119
120</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/events.rb', line 118</span>

<span class='kw'>def</span> <span class='id identifier rubyid_has_events?'>has_events?</span>
  <span class='op'>!</span><span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_is_blank?'>is_blank?</span><span class='lparen'>(</span><span class='ivar'>@event_set</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="off-instance_method">
  
    - (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>off</strong>(*events) 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


138
139
140
141
142
143
144
145
146
147
148
149</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/events.rb', line 138</span>

<span class='kw'>def</span> <span class='id identifier rubyid_off'>off</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_events'>events</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_events'>events</span><span class='period'>.</span><span class='id identifier rubyid_flatten!'>flatten!</span>
  <span class='id identifier rubyid_events'>events</span> <span class='op'>=</span> <span class='ivar'>@event_set</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span> <span class='kw'>if</span> <span class='id identifier rubyid_events'>events</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>==</span> <span class='int'>0</span>

  <span class='id identifier rubyid_events'>events</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_event'>event</span><span class='op'>|</span> 
    <span class='kw'>if</span> <span class='id identifier rubyid_rm_event'>rm_event</span> <span class='op'>=</span> <span class='ivar'>@event_set</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_event'>event</span><span class='rparen'>)</span>
      <span class='id identifier rubyid_rm_event'>rm_event</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span> 
    <span class='kw'>end</span>
  <span class='kw'>end</span>

  <span class='kw'>self</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="on-instance_method">
  
    - (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>on</strong>(view, event, args = {}, &amp;block) 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


126
127
128
129
130
131
132
133
134
135
136</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/events.rb', line 126</span>

<span class='kw'>def</span> <span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='comma'>,</span> <span class='id identifier rubyid_event'>event</span><span class='comma'>,</span> <span class='id identifier rubyid_args'>args</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>[RMQ Error]  Event already exists on this object: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_event'>event</span><span class='rbrace'>}</span><span class='tstring_content'>. Remove first, using .off</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='ivar'>@event_set</span><span class='lbracket'>[</span><span class='id identifier rubyid_event'>event</span><span class='rbracket'>]</span>

  <span class='kw'>if</span> <span class='id identifier rubyid_rmqe'>rmqe</span> <span class='op'>=</span> <span class='const'>RubyMotionQuery</span><span class='op'>::</span><span class='const'>Event</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='comma'>,</span> <span class='id identifier rubyid_event'>event</span><span class='comma'>,</span> <span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
    <span class='id identifier rubyid_rmqe'>rmqe</span><span class='period'>.</span><span class='id identifier rubyid_set_options'>set_options</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>

    <span class='ivar'>@event_set</span><span class='lbracket'>[</span><span class='id identifier rubyid_event'>event</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_rmqe'>rmqe</span>
  <span class='kw'>end</span>

  <span class='id identifier rubyid_view'>view</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>

    <div id="footer">
  Generated on Sun Dec  8 20:15:51 2013 by
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.8.7.3 (ruby-1.9.3).
</div>

  </body>
</html>